//
//  XJHttpTool.h
//  网络请求工具类
//
//  Created by RaoBo on 2018/5/3.
//  Copyright © 2018年 关键词. All rights reserved.
//  网络请求工具类
#import <Foundation/Foundation.h>
/**请求成功回调*/
typedef void(^SuccessBlock) (id responseObjc);

/**请求失败回调*/
typedef void (^FailureBlock)(NSError *error);

@interface XJHttpTool : NSObject

#pragma mark - 首页相关接口
/**
 1.获取首页数据

 @param zuobiaoDic 坐标(经、纬度)
 */
+ (void)requestHomeDataWithCoordinate:(NSDictionary *)zuobiaoDic
                       SuccessHandler:(SuccessBlock)succes
                       failureHandler:(FailureBlock)failure;
/**2 */

/**
 2 首页-宅配圈-搜索商品 / 搜索店铺

 @param type 1 搜索商品(search_goods) 2 搜索店铺(search_shops)
 @param keyword 要搜索的关键词
 @param lat 维度
 @param lng 经度
 @param page 页数 刷新加载
 */
+ (void)requestHomeSearchWithType:(NSString *)type keyWord:(NSString *)keyword lat:(NSString *)lat lng:(NSString *)lng page:(NSString *)page successH:(SuccessBlock)success failH:(FailureBlock)fail;
/**首页:秒杀商品*/
+ (void)requestHomeSecKillWithParDic:(NSDictionary *)dic successH:(SuccessBlock)success failH:(FailureBlock)fail;
/**获取七牛云token*/
+ (void)requestQiNiuTokenSuccessH:(SuccessBlock)success fialH:(FailureBlock)fail;
/**获取在线客服点好号码*/
+ (void)requestOnlineServicePhoneSuccessH:(SuccessBlock)success failH:(FailureBlock)fail;


#pragma mark - 店铺相关接口 shop
/**
 .获取店铺详情数据

 @param shopId 店铺 `id`
 */
+ (void)requestShopInfoId:(NSString *)shopId
               successHandler:(SuccessBlock)success
               failureHandler:(FailureBlock)failure;


/**
 获取店铺 分类数据

 @param parDic {page:,page_size,shop_id:shop_goods_category_id:}
 需要处理上拉刷新 下拉加载
 */
+ (void)requestShopCategoryDic:(NSDictionary *)parDic successHandler:(SuccessBlock)success failHandler:(FailureBlock)failure;
/**点击“宅配圈” 获取店铺列表*/
+ (void)requestShopListWithLat:(NSString *)lat lng:(NSString *)lng page:(NSString *)page successH:(SuccessBlock)success failH:(FailureBlock)fail;

#pragma mark - 商品 `goods`
/**
 获取商品详情数据

 @param goodsId 商品id
 */
+ (void)requestGoodsInfo:(NSString *)goodsId
          successHandler:(SuccessBlock)success
          failureHandler:(FailureBlock)failure;
/**获取收藏列表*/
+ (void)requestShouCangSuccessHandler:(SuccessBlock)succes failureHandler:(FailureBlock)failure;


/**
 删除收藏的商品

 @param ids (String) 要删除的商品的ids字符串 逗号隔开
 */
+ (void)requestDeleteShouCangWithIds:(NSString *)ids successH:(SuccessBlock)success failureH:(FailureBlock)fail;


/**
 收藏商品

 @param goodId 商品id
 */
+ (void)requestAddShouCangWithGoods_id:(NSString *)goodId successH:(SuccessBlock)success failH:(FailureBlock)fail;
/**取消收藏商品*/
+ (void)requestCancelShouCangGoodsWithGoodsId:(NSString *)goods_id successH:(SuccessBlock)success fail:(FailureBlock)fail;


/**推荐商品*/
+ (void)requestRecomendGoodsWithDic:(NSDictionary *)dic successH:(SuccessBlock)success failH:(FailureBlock)fail;

/**商品详情----》查看全部评论*/
+ (void)requestGoodsAllEvaluateWithGoodsId:(NSString *)goods_id successH:(SuccessBlock)success failH:(FailureBlock)fail;

#pragma mark - 登录注册

/**
 登录

 @param phoneNum 手机号
 @param pwd 密码
 */
+ (void)requestLoginWithPhoneNum:(NSString *)phoneNum password:(NSString *)pwd successHandler:(SuccessBlock)succes failureHandler:(FailureBlock)failure;

/**
 注册
 @param parDic 参数字典{avatar,sex,nickname,password,phone}
 */
+ (void)requestRegisterParameter:(NSDictionary *)parDic successHandler:(SuccessBlock)succes failureHandler:(FailureBlock)fail;

/**
 发送验证码

 @param phone 手机号
 @param type 验证码类型
 forget忘记密码
 regist注册
 
 */
+ (void)requestSendCodeWithPhone:(NSString *)phone type:(NSString *)type successH:(SuccessBlock)success failureH:(FailureBlock)fail;

/**
验证验证码

 @param phone 手机号
 @param code 验证码
 @param type 验证码类型
 */
+ (void)requestVerifyCodeWithPhone:(NSString *)phone code:(NSString *)code type:(NSString *)type successH:(SuccessBlock)success failureH:(FailureBlock)fail;

/**
 忘记密码

 @param dic 请求参数
 */
+ (void)requestForgetPwdWithDic:(NSDictionary *)dic succesH:(SuccessBlock)success failH:(FailureBlock)fail;
/**获取个人详细信息*/
+ (void)requestCustomDetailSuccesH:(SuccessBlock)success failH:(FailureBlock)fail;
/**查看资金明细*/
+ (void)requestCustomAccountFinanceLsitWithFinceType:(NSString *)finance_type successH:(SuccessBlock)success failH:(FailureBlock)fail;

/**提现账户列表*/
+ (void)requestCustomAccountAccountListSuccessH:(SuccessBlock)success failH:(FailureBlock)fail;

/**添加提现账户*/
+ (void)requestCustomAccountAddAccountWithParDic:(NSDictionary *)parDic successH:(SuccessBlock)success failH:(FailureBlock)fail;
/**提现  支付宝提现和 银行卡提现分别对应不同的model*/
+ (void)requestCustomAccountTiXianWithParDic:(NSDictionary *)parDic successH:(SuccessBlock)success failH:(FailureBlock)fail;


#pragma mark - 分类
/**获取分类数据5-10*/
+ (void)requestCategoryDataSuccessHandler:(SuccessBlock)success failureHandler:(FailureBlock)failure;
/**2.点击分类item跳转到二级页面数据*/
+ (void)requestCategorySecondPageDataWithDic:(NSDictionary *)dic successH:(SuccessBlock)success failH:(FailureBlock)fail;



#pragma mark - ======五 购物车 customer======
/**加入购物车*/
+ (void)requestAddCartDic:(NSDictionary *)dic successH:(SuccessBlock)success failureH:(FailureBlock)fail;

/**获取购物车列表*/
+ (void)requestCartListSuccessH:(SuccessBlock)success failureH:(FailureBlock)fail;
/**删除购物车*/
+ (void)requestDeleteCartWithIdsStr:(NSString *)idsStr successH:(SuccessBlock)success failH:(FailureBlock)fail;


#pragma mark - ======六 收货地址 customer_address=======
/**获取地址列表*/
+ (void)requestAddressListSuccessH:(SuccessBlock)success failureH:(FailureBlock)fail;
/**增加地址*/
+ (void)requestAddNewAddressWithDic:(NSDictionary *)dic successH:(SuccessBlock)success failH:(FailureBlock)fail;
/**删除地址*/
+ (void)requestDeleteAddressWithDistrictId:(NSString *)districtId successH:(SuccessBlock)success failH:(FailureBlock)fail;

/**设置默认收货地址*/
+ (void)requestDefaultAddressWithDistrictId:(NSString *)districtId successH:(SuccessBlock)success fialH:(FailureBlock)fail;

#pragma mark - =======七 个人信息  customer/edit =========
/**
 修改个人信息 姓名  性别
 
 @param nickname 姓名 可以为空。 如果传nil 就忽略该参数
 @param sex 性别    可以为空。   如果传nil 就忽略该参数
 @param avator 头像的url 可以空  如果传nil 就忽略该参数
 */
+ (void)requestEditPersonMessageWithName:(NSString *)nickname sex:(NSString *)sex avator:(NSString *)avator successH:(SuccessBlock)succes failH:(FailureBlock)fail;

/**修改登录密码*/
+ (void)requestModifyLoginPwd:(NSString *)pwd successH:(SuccessBlock )succe failH:(FailureBlock)fail;

/**修改支付密码*/
+ (void)requestModifyPayPwd:(NSString *)pwd successH:(SuccessBlock)success failH:(FailureBlock)fail;


#pragma mark - ======== 八 订单相关 order/balance ==========
/**GET order/balance 点击立即购买 获取数据*/
+ (void)requestBuyNowWithDic:(NSDictionary *)dic successH:(SuccessBlock)success failH:(FailureBlock)fail;
/**点击立即下单调的第一个接口*/
+ (void)requestOrderGenerateOrderWithDic:(NSDictionary *)dic successH:(SuccessBlock)succes failH:(FailureBlock)fail;
/**我的页面 获取待付款 上面的角标*/
+ (void)requestOrderOrderCountSuccessH:(SuccessBlock)success failH:(FailureBlock)fail;
/**获取订单列表(全部、待付款、待收货、...) 6-14
 type 订单类型(0为全部,1为待付款,2为待收货,3为待评价,4为已完成)
 page:
 */
+ (void)requestOrderOrderListsWithType:(NSString *)type page:(NSString *)page successH:(SuccessBlock)success failH:(FailureBlock)fail;
/**取消订单 6-14*/
+ (void)requestOrderCancelOrderWithOrderNum:(NSString *)order_sn successH:(SuccessBlock)success failH:(FailureBlock)fail;
/**删除订单 6-14*/
+ (void)requestOrderDeleteOrderWithOrderSN:(NSString *)order_sn successH:(SuccessBlock)success failH:(FailureBlock)fail;
/**确认收货 6-15*/
+ (void)requestOrderReceiveWithOrderSN:(NSString *)order_sn successH:(SuccessBlock)success failH:(FailureBlock)fail;
/**订单详情*/
+ (void)requestOrderDetailWithOrderSN:(NSString *)orderSn successH:(SuccessBlock)success failH:(FailureBlock)fail;




#pragma mark - ========九 社区  community ============
/**点击首页--标签---->社区在线---->跳转的接口*/
+ (void)requestCommunityNearestWithLng:(NSString *)lng
                                   lat:(NSString *)lat
                              successH:(SuccessBlock)success
                                 failH:(FailureBlock)fail;

/**社区--服务类别*/
+ (void)requestCommunityServeCategorySuccessH:(SuccessBlock)success failH:(FailureBlock)fail;
/**申请服务*/
+ (void)requestCommunitySubmitServeDic:(NSDictionary *)dic successH:(SuccessBlock)succes failH:(FailureBlock)fail;

/**社区--服务记录*/
+ (void)requestCommunityServeListWithCommunityId:(NSString *)community_id successH:(SuccessBlock)success failH:(FailureBlock)fail;
/**社区--服务记录--详情*/
+ (void)requestCommunityServiceDetailWithServiceId:(NSString *)serviceId successH:(SuccessBlock)success fialH:(FailureBlock)fail;

/**
 首页--社区--我要服务 -- 社区服务记录----详情 ---取消
 首页--社区--我要服务 -- 社区服务记录---删除

 @param path 最后一节路径 除了路径不一样其他都一样,so 不想写重复代码
 @param service_id 服务id
 */
+ (void)requestCommunityServiceCancelWithURLPath:(NSString *)path Service_id:(NSString *)service_id successH:(SuccessBlock)success failH:(FailureBlock)fail;

/**首页--社区--进入搜索页面*/
+ (void)requestCommunityToSearchWithLat:(NSString *)lat lng:(NSString *)lng customId:(NSString *)customer_id successH:(SuccessBlock)success fialH:(FailureBlock)fail;

/**首页--社区--进入搜索页面--进入小区*/
+ (void)requestCommunityEnterCommunity_id:(NSString *)community_id customer_id:(NSString *)customer_id successH:(SuccessBlock)success failH:(FailureBlock)fail;

/**首页--社区--进入搜索页面--搜索小区*/
+ (void)requestCommunitySearchWithLng:(NSString *)lng lat:(NSString *)lat name:(NSString *)name successH:(SuccessBlock)success failH:(FailureBlock)fail;
/**社区认证 后两个参数可以为空 proprietor_phone proprietor_relation 可以为空*/
+ (void)requestCommunityIdentityWithParDic:(NSDictionary *)parDic successH:(SuccessBlock)success failH:(FailureBlock)fail;
/**是否通过了社区认证 返回结果 status 1为正在审核，2审核通过，3为审核失败*/
+ (void)requestCommunityIdentityIsIdentityWithCmtId:(NSString *)community_id successH:(SuccessBlock)success failH:(FailureBlock)fail;
/**3.社区认证详情*/
+ (void)requestCommunityIdentityDetailWithCommunityID:(NSString *)community_id successH:(SuccessBlock)success failH:(FailureBlock)fail;
/**4.社区认证列表*/
+ (void)requestCommunityIdentityListSuccessH:(SuccessBlock)success failH:(FailureBlock)fail;






#pragma mark - ========十 帖子  invitation(请帖、邀请) ============
/**首页---本地旅游---搜索城市帖子*/
+ (void)requestInvitationFindCity:(NSString *)city keyword:(NSString *)title successH:(SuccessBlock)success failH:(FailureBlock)fail;

/**1-2.首页--tag-- 本地旅游-- 城市帖子界面*/
+ (void)requestInvitationCityPageCity:(NSString *)cityStr successH:(SuccessBlock)success failH:(FailureBlock)fail;

/**帖子分三种:城市:city 、社区:community、有名堂:ymt
 直接传个字典
 */
+ (void)requestInvitationListWithDic:(NSDictionary *)dic succesH:(SuccessBlock)success failH:(FailureBlock)fail;

/**点击进入帖子详情 用最原始的AFN GET请求 城市:city 、社区:community、有名堂:ymt*/
+ (void)requestInvitationDetailInfoWithDic:(NSDictionary *)dic successH:(SuccessBlock)success failH:(FailureBlock)fail;
/**搜索有名堂*/
+ (void)requestInvitationYMTSearchTopicsWithTitle:(NSString *)title successH:(SuccessBlock)success failH:(FailureBlock)fail;
/** 评论帖子 */
+ (void)requestInvitationCommentWithDic:(NSDictionary *)dic succesH:(SuccessBlock)success failH:(FailureBlock)fail;

/**删除评论*/
+ (void)requestInvitationDeleteCommentWithCommentId:(NSString *)commentId successH:(SuccessBlock)success failH:(FailureBlock)fail;

/**跳转举报页面*/
+ (void)requestInvitationSkipToJuBaoPageSuccessH:(SuccessBlock)success failH:(FailureBlock)fail;

/**举报*/
+ (void)requestInvitationJuBaoTieZiWithDic:(NSDictionary *)dic successH:(SuccessBlock)success failH:(FailureBlock)fail;


#pragma mark - ========十 -2 帖子收藏  invitationCollection  ============
+ (void)requestInvitationCollectionListSuccessH:(SuccessBlock)success failH:(FailureBlock)fail;
+ (void)requestInvitationCollectionDeleteWithIds:(NSString *)ids successH:(SuccessBlock)success failH:(FailureBlock)fail;
/**收藏帖子*/
+ (void)requestInvitationColllectionCollectionWithInvitation_id:(NSString *)invitation_id successH:(SuccessBlock)success failH:(FailureBlock)fail;


#pragma mark - ========十一 支付  invitation ============
/**预支付接口
 7-10 备注服务器新加了一个字段  直接购买传0,从待支付页面进入传1
 */
+ (void)requestPayPrepayWithDic:(NSDictionary *)dic successH:(SuccessBlock)success failH:(FailureBlock)fail;
/**支付*/
+ (void)requestPayWithDic:(NSDictionary *)payDic successH:(SuccessBlock)success failH:(FailureBlock)fail;


#pragma mark - ========十二 售后相关  refund ============
/**跳转评价售后先调用的一个接口*/
+ (void)requestOrderOrderPageWithOrderGoodsId:(NSString *)order_goods_id successH:(SuccessBlock)success failH:(FailureBlock)fail;

/**申请售后*/
+ (void)requestRefundCommitRefundWithDic:(NSDictionary *)dic successH:(SuccessBlock)success failH:(FailureBlock)fail;

/**评价订单*/
+ (void)requestOrderCommentWithDic:(NSDictionary *)dic successH:(SuccessBlock)success failH:(FailureBlock)fail;

/**获取售后列表 不做加载 刷新*/
+ (void)requestRefoundListSuccessH:(SuccessBlock)success failH:(FailureBlock)fail;


#pragma mark - ========十三 首页先关 ============
//首页tag---超市商场--大类
+ (void)requestHomeTagSupermarketWithGoodsCategoryId:(NSString *)goods_cty_id successH:(SuccessBlock)success failH:(FailureBlock)fail;


#pragma mark - ========== 十四 消息管理 ==========
/**
 获取消息列表

 @param msgType 消息类型 1:系统消息 2:订单消息
 @param page 用于刷新加载
 */
+ (void)requestCustomMessageListWithMsgType:(NSString *)msgType page:(NSString *)page successH:(SuccessBlock)success failH:(FailureBlock)fail;

/**消息管理--- 评论消息*/
+ (void)requestInvitationReplyMeWithPage:(NSString *)page successH:(SuccessBlock)success failH:(FailureBlock)fail;



#pragma mark - 十五  实名认证
/**检查是否进行了实名认证*/
+ (void)requestCustomIsIdentitySuccesH:(SuccessBlock)success failH:(FailureBlock)fail;
/**进行实名认证*/
+ (void)requetCustomIdentityWithParDic:(NSDictionary *)dic successH:(SuccessBlock)success failH:(FailureBlock)fail;


@end
